from django import newforms as forms

import models
from google.appengine.ext.db import djangoforms

class PostForm(forms.Form):
	title = forms.CharField()
	content = forms.CharField(widget=forms.Textarea())

	def save(self):
		post = models.Post(title = self.clean_data['title'], content = self.clean_data['content'])
		post.put()
		
class CommentForm(forms.Form):
	comments_title = forms.CharField(widget=forms.Textarea())
	comments_content = forms.CharField(widget=forms.Textarea())

	def save(self):
		comment = models.Comments(comments_title = self.clean_data['comments_title'],comments_content = self.clean_data['comments_content'])
		comment.put()

